Optimal. Leaf size=487 \[ -\frac {(a-b) \sqrt {a+b} B \sqrt {\cos (c+d x)} \csc (c+d x) E\left (\text {ArcSin}\left (\frac {\sqrt {a+b \cos (c+d x)}}{\sqrt {a+b} \sqrt {\cos (c+d x)}}\right )|-\frac {a+b}{a-b}\right ) \sqrt {\frac {a (1-\sec (c+d x))}{a+b}} \sqrt {\frac {a (1+\sec (c+d x))}{a-b}}}{a b d \sqrt {\sec (c+d x)}}+\frac {\sqrt {a+b} B \sqrt {\cos (c+d x)} \csc (c+d x) F\left (\text {ArcSin}\left (\frac {\sqrt {a+b \cos (c+d x)}}{\sqrt {a+b} \sqrt {\cos (c+d x)}}\right )|-\frac {a+b}{a-b}\right ) \sqrt {\frac {a (1-\sec (c+d x))}{a+b}} \sqrt {\frac {a (1+\sec (c+d x))}{a-b}}}{b d \sqrt {\sec (c+d x)}}-\frac {\sqrt {a+b} (2 A b-a B) \sqrt {\cos (c+d x)} \csc (c+d x) \Pi \left (\frac {a+b}{b};\text {ArcSin}\left (\frac {\sqrt {a+b \cos (c+d x)}}{\sqrt {a+b} \sqrt {\cos (c+d x)}}\right )|-\frac {a+b}{a-b}\right ) \sqrt {\frac {a (1-\sec (c+d x))}{a+b}} \sqrt {\frac {a (1+\sec (c+d x))}{a-b}}}{b^2 d \sqrt {\sec (c+d x)}}+\frac {B \sin (c+d x)}{d \sqrt {a+b \cos (c+d x)} \sqrt {\sec (c+d x)}}+\frac {a B \sqrt {\sec (c+d x)} \sin (c+d x)}{b d \sqrt {a+b \cos (c+d x)}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.79, antiderivative size = 487, normalized size of antiderivative = 1.00, number of steps
used = 8, number of rules used = 8, integrand size = 35, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.229, Rules used = {3040, 3082,
3130, 2888, 3072, 3077, 2895, 3073} \begin {gather*} -\frac {\sqrt {a+b} (2 A b-a B) \sqrt {\cos (c+d x)} \csc (c+d x) \sqrt {\frac {a (1-\sec (c+d x))}{a+b}} \sqrt {\frac {a (\sec (c+d x)+1)}{a-b}} \Pi \left (\frac {a+b}{b};\text {ArcSin}\left (\frac {\sqrt {a+b \cos (c+d x)}}{\sqrt {a+b} \sqrt {\cos (c+d x)}}\right )|-\frac {a+b}{a-b}\right )}{b^2 d \sqrt {\sec (c+d x)}}+\frac {B \sqrt {a+b} \sqrt {\cos (c+d x)} \csc (c+d x) \sqrt {\frac {a (1-\sec (c+d x))}{a+b}} \sqrt {\frac {a (\sec (c+d x)+1)}{a-b}} F\left (\text {ArcSin}\left (\frac {\sqrt {a+b \cos (c+d x)}}{\sqrt {a+b} \sqrt {\cos (c+d x)}}\right )|-\frac {a+b}{a-b}\right )}{b d \sqrt {\sec (c+d x)}}-\frac {B (a-b) \sqrt {a+b} \sqrt {\cos (c+d x)} \csc (c+d x) \sqrt {\frac {a (1-\sec (c+d x))}{a+b}} \sqrt {\frac {a (\sec (c+d x)+1)}{a-b}} E\left (\text {ArcSin}\left (\frac {\sqrt {a+b \cos (c+d x)}}{\sqrt {a+b} \sqrt {\cos (c+d x)}}\right )|-\frac {a+b}{a-b}\right )}{a b d \sqrt {\sec (c+d x)}}+\frac {a B \sin (c+d x) \sqrt {\sec (c+d x)}}{b d \sqrt {a+b \cos (c+d x)}}+\frac {B \sin (c+d x)}{d \sqrt {\sec (c+d x)} \sqrt {a+b \cos (c+d x)}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2888
Rule 2895
Rule 3040
Rule 3072
Rule 3073
Rule 3077
Rule 3082
Rule 3130
Rubi steps
\begin {align*} \int \frac {A+B \cos (c+d x)}{\sqrt {a+b \cos (c+d x)} \sqrt {\sec (c+d x)}} \, dx &=\left (\sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)}\right ) \int \frac {\sqrt {\cos (c+d x)} (A+B \cos (c+d x))}{\sqrt {a+b \cos (c+d x)}} \, dx\\ &=\frac {B \sin (c+d x)}{d \sqrt {a+b \cos (c+d x)} \sqrt {\sec (c+d x)}}+\frac {1}{2} \left (\sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)}\right ) \int \frac {a B+2 a A \cos (c+d x)+(2 A b-a B) \cos ^2(c+d x)}{\sqrt {\cos (c+d x)} (a+b \cos (c+d x))^{3/2}} \, dx\\ &=\frac {B \sin (c+d x)}{d \sqrt {a+b \cos (c+d x)} \sqrt {\sec (c+d x)}}+\frac {\left (\sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)}\right ) \int \frac {a b B+(2 a A b-a (2 A b-a B)) \cos (c+d x)}{\sqrt {\cos (c+d x)} (a+b \cos (c+d x))^{3/2}} \, dx}{2 b}+\frac {\left ((2 A b-a B) \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)}\right ) \int \frac {\sqrt {\cos (c+d x)}}{\sqrt {a+b \cos (c+d x)}} \, dx}{2 b}\\ &=-\frac {\sqrt {a+b} (2 A b-a B) \sqrt {\cos (c+d x)} \csc (c+d x) \Pi \left (\frac {a+b}{b};\sin ^{-1}\left (\frac {\sqrt {a+b \cos (c+d x)}}{\sqrt {a+b} \sqrt {\cos (c+d x)}}\right )|-\frac {a+b}{a-b}\right ) \sqrt {\frac {a (1-\sec (c+d x))}{a+b}} \sqrt {\frac {a (1+\sec (c+d x))}{a-b}}}{b^2 d \sqrt {\sec (c+d x)}}+\frac {B \sin (c+d x)}{d \sqrt {a+b \cos (c+d x)} \sqrt {\sec (c+d x)}}+\frac {a B \sqrt {\sec (c+d x)} \sin (c+d x)}{b d \sqrt {a+b \cos (c+d x)}}+\frac {\left (\sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)}\right ) \int \frac {a b^2 B-a (2 a A b-a (2 A b-a B))+\left (a^2 b B-b (2 a A b-a (2 A b-a B))\right ) \cos (c+d x)}{\cos ^{\frac {3}{2}}(c+d x) \sqrt {a+b \cos (c+d x)}} \, dx}{2 b \left (a^2-b^2\right )}\\ &=-\frac {\sqrt {a+b} (2 A b-a B) \sqrt {\cos (c+d x)} \csc (c+d x) \Pi \left (\frac {a+b}{b};\sin ^{-1}\left (\frac {\sqrt {a+b \cos (c+d x)}}{\sqrt {a+b} \sqrt {\cos (c+d x)}}\right )|-\frac {a+b}{a-b}\right ) \sqrt {\frac {a (1-\sec (c+d x))}{a+b}} \sqrt {\frac {a (1+\sec (c+d x))}{a-b}}}{b^2 d \sqrt {\sec (c+d x)}}+\frac {B \sin (c+d x)}{d \sqrt {a+b \cos (c+d x)} \sqrt {\sec (c+d x)}}+\frac {a B \sqrt {\sec (c+d x)} \sin (c+d x)}{b d \sqrt {a+b \cos (c+d x)}}+\frac {\left (a B \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)}\right ) \int \frac {1}{\sqrt {\cos (c+d x)} \sqrt {a+b \cos (c+d x)}} \, dx}{2 b}-\frac {\left (a B \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)}\right ) \int \frac {1+\cos (c+d x)}{\cos ^{\frac {3}{2}}(c+d x) \sqrt {a+b \cos (c+d x)}} \, dx}{2 b}\\ &=-\frac {(a-b) \sqrt {a+b} B \sqrt {\cos (c+d x)} \csc (c+d x) E\left (\sin ^{-1}\left (\frac {\sqrt {a+b \cos (c+d x)}}{\sqrt {a+b} \sqrt {\cos (c+d x)}}\right )|-\frac {a+b}{a-b}\right ) \sqrt {\frac {a (1-\sec (c+d x))}{a+b}} \sqrt {\frac {a (1+\sec (c+d x))}{a-b}}}{a b d \sqrt {\sec (c+d x)}}+\frac {\sqrt {a+b} B \sqrt {\cos (c+d x)} \csc (c+d x) F\left (\sin ^{-1}\left (\frac {\sqrt {a+b \cos (c+d x)}}{\sqrt {a+b} \sqrt {\cos (c+d x)}}\right )|-\frac {a+b}{a-b}\right ) \sqrt {\frac {a (1-\sec (c+d x))}{a+b}} \sqrt {\frac {a (1+\sec (c+d x))}{a-b}}}{b d \sqrt {\sec (c+d x)}}-\frac {\sqrt {a+b} (2 A b-a B) \sqrt {\cos (c+d x)} \csc (c+d x) \Pi \left (\frac {a+b}{b};\sin ^{-1}\left (\frac {\sqrt {a+b \cos (c+d x)}}{\sqrt {a+b} \sqrt {\cos (c+d x)}}\right )|-\frac {a+b}{a-b}\right ) \sqrt {\frac {a (1-\sec (c+d x))}{a+b}} \sqrt {\frac {a (1+\sec (c+d x))}{a-b}}}{b^2 d \sqrt {\sec (c+d x)}}+\frac {B \sin (c+d x)}{d \sqrt {a+b \cos (c+d x)} \sqrt {\sec (c+d x)}}+\frac {a B \sqrt {\sec (c+d x)} \sin (c+d x)}{b d \sqrt {a+b \cos (c+d x)}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains complex when optimal does not.
time = 18.06, size = 1091, normalized size = 2.24 \begin {gather*} \frac {\sqrt {\frac {a+b+a \tan ^2\left (\frac {1}{2} (c+d x)\right )-b \tan ^2\left (\frac {1}{2} (c+d x)\right )}{1+\tan ^2\left (\frac {1}{2} (c+d x)\right )}} \left (a \sqrt {\frac {a-b}{a+b}} B \tan \left (\frac {1}{2} (c+d x)\right )+b \sqrt {\frac {a-b}{a+b}} B \tan \left (\frac {1}{2} (c+d x)\right )-2 b \sqrt {\frac {a-b}{a+b}} B \tan ^3\left (\frac {1}{2} (c+d x)\right )-a \sqrt {\frac {a-b}{a+b}} B \tan ^5\left (\frac {1}{2} (c+d x)\right )+b \sqrt {\frac {a-b}{a+b}} B \tan ^5\left (\frac {1}{2} (c+d x)\right )-4 i A b \Pi \left (\frac {a+b}{a-b};i \sinh ^{-1}\left (\sqrt {\frac {a-b}{a+b}} \tan \left (\frac {1}{2} (c+d x)\right )\right )|-\frac {a+b}{a-b}\right ) \sqrt {1-\tan ^2\left (\frac {1}{2} (c+d x)\right )} \sqrt {\frac {a+b+a \tan ^2\left (\frac {1}{2} (c+d x)\right )-b \tan ^2\left (\frac {1}{2} (c+d x)\right )}{a+b}}+2 i a B \Pi \left (\frac {a+b}{a-b};i \sinh ^{-1}\left (\sqrt {\frac {a-b}{a+b}} \tan \left (\frac {1}{2} (c+d x)\right )\right )|-\frac {a+b}{a-b}\right ) \sqrt {1-\tan ^2\left (\frac {1}{2} (c+d x)\right )} \sqrt {\frac {a+b+a \tan ^2\left (\frac {1}{2} (c+d x)\right )-b \tan ^2\left (\frac {1}{2} (c+d x)\right )}{a+b}}-4 i A b \Pi \left (\frac {a+b}{a-b};i \sinh ^{-1}\left (\sqrt {\frac {a-b}{a+b}} \tan \left (\frac {1}{2} (c+d x)\right )\right )|-\frac {a+b}{a-b}\right ) \tan ^2\left (\frac {1}{2} (c+d x)\right ) \sqrt {1-\tan ^2\left (\frac {1}{2} (c+d x)\right )} \sqrt {\frac {a+b+a \tan ^2\left (\frac {1}{2} (c+d x)\right )-b \tan ^2\left (\frac {1}{2} (c+d x)\right )}{a+b}}+2 i a B \Pi \left (\frac {a+b}{a-b};i \sinh ^{-1}\left (\sqrt {\frac {a-b}{a+b}} \tan \left (\frac {1}{2} (c+d x)\right )\right )|-\frac {a+b}{a-b}\right ) \tan ^2\left (\frac {1}{2} (c+d x)\right ) \sqrt {1-\tan ^2\left (\frac {1}{2} (c+d x)\right )} \sqrt {\frac {a+b+a \tan ^2\left (\frac {1}{2} (c+d x)\right )-b \tan ^2\left (\frac {1}{2} (c+d x)\right )}{a+b}}+i (a-b) B E\left (i \sinh ^{-1}\left (\sqrt {\frac {a-b}{a+b}} \tan \left (\frac {1}{2} (c+d x)\right )\right )|-\frac {a+b}{a-b}\right ) \sqrt {1-\tan ^2\left (\frac {1}{2} (c+d x)\right )} \left (1+\tan ^2\left (\frac {1}{2} (c+d x)\right )\right ) \sqrt {\frac {a+b+a \tan ^2\left (\frac {1}{2} (c+d x)\right )-b \tan ^2\left (\frac {1}{2} (c+d x)\right )}{a+b}}+2 i (A b-a B) F\left (i \sinh ^{-1}\left (\sqrt {\frac {a-b}{a+b}} \tan \left (\frac {1}{2} (c+d x)\right )\right )|-\frac {a+b}{a-b}\right ) \sqrt {1-\tan ^2\left (\frac {1}{2} (c+d x)\right )} \left (1+\tan ^2\left (\frac {1}{2} (c+d x)\right )\right ) \sqrt {\frac {a+b+a \tan ^2\left (\frac {1}{2} (c+d x)\right )-b \tan ^2\left (\frac {1}{2} (c+d x)\right )}{a+b}}\right )}{b \sqrt {\frac {a-b}{a+b}} d \left (-1+\tan ^2\left (\frac {1}{2} (c+d x)\right )\right ) \sqrt {\frac {1+\tan ^2\left (\frac {1}{2} (c+d x)\right )}{1-\tan ^2\left (\frac {1}{2} (c+d x)\right )}} \left (b \left (-1+\tan ^2\left (\frac {1}{2} (c+d x)\right )\right )-a \left (1+\tan ^2\left (\frac {1}{2} (c+d x)\right )\right )\right )} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(1006\) vs.
\(2(443)=886\).
time = 0.55, size = 1007, normalized size = 2.07
method | result | size |
default | \(\text {Expression too large to display}\) | \(1007\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {A + B \cos {\left (c + d x \right )}}{\sqrt {a + b \cos {\left (c + d x \right )}} \sqrt {\sec {\left (c + d x \right )}}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.00 \begin {gather*} \int \frac {A+B\,\cos \left (c+d\,x\right )}{\sqrt {\frac {1}{\cos \left (c+d\,x\right )}}\,\sqrt {a+b\,\cos \left (c+d\,x\right )}} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________